package com.card.game;

import java.util.List;
import java.util.Set;

import com.google.common.collect.Sets;

public class ZjhInfo {
	public String userId;
	public boolean isKanPai;//是否已经看牌了
	public int betNum;//本局下注的金额
	private boolean isLost;//被比下去了
	public boolean isQiPai;//是否已经弃牌
	private transient Set<Integer> biPaiList = Sets.newConcurrentHashSet();
	
	public ZjhInfo(String userId) {
		this.userId = userId;
	}
	
	public boolean isOver() {
		return isLost || isQiPai;
	}
	
	public void lost() {
		this.isLost = true;
	}
	public void qiPai() {
		this.isQiPai = true;
	}
	
	public void addBiPaiUser(BasePlayer tempPlayer) {
		this.biPaiList.add(tempPlayer.getTableIndex());
	}
	public void addBiPaiUser(List<Integer> indexs) {
		this.biPaiList.addAll(indexs);
	}
	public boolean isContains(int index) {
		return this.biPaiList.contains(index);
	}
	
	public void clear() {
		this.isKanPai = false;
		this.betNum = 0;
		this.isLost = false;
		this.isQiPai = false;
		this.biPaiList.clear();
	}
}
